<script type="text/javascript">
    $(document).ready(function(){
        $('#tanggal').datepicker({dateFormat:"yy/mm/dd"});
    })
</script>
<fieldset><legend>Pembelian</legend>
<?
echo form_open('pembelian');
echo "Tampilkan tanggal <input type=text value='$tanggal' id=tanggal name=tanggal><input type=submit value=Tampilkan><br>";
echo form_close();
echo anchor('pembelian/transaksi_form', 'Transaksi Pembelian');
$atts = array(
              'width'      => '800',
              'height'     => '600',
              'scrollbars' => 'yes',
              'status'     => 'yes',
              'resizable'  => 'yes',
              'screenx'    => '0',
              'screeny'    => '0'
            );
?>
<table class="table-main">
    <tr>
        <td>
            ID Pembelian
        </td>
        <td>
            Distributor
        </td>
        <td>
            Tanggal Pembelian
        </td>
        <td>
            Jumlah Barang
        </td>
    </tr>

<?php
    foreach($listPembelian as $pembelian){
        echo"
            <tr>
                <td>
                    ".anchor_popup('report/pembelian_nota/'.$pembelian->id,$pembelian->id , $atts)."
                </td>
                <td>
                    $pembelian->nama_distributor
                </td>
                <td>
                    $pembelian->tgl_pembelian
                </td>
                <td>
                    $pembelian->jumlah_pembelian
                </td>
            </tr>
        ";
    }
?>
</table>
    </fieldset>